import {
	API_PREFIX,
	API_PREFIX_CORE
} from '../config/env.js'
import http from '../utils/http.js'

export const API = {
	GET_STORE_DOWNLOAD: `${API_PREFIX_CORE}/api/v1/common/store/download`,
	GET_JY_HISTORY: `${API_PREFIX_CORE}/api/v1/jy/history`,
	GET_CUSTOMER_PAGE: `${API_PREFIX_CORE}/api/v1/common/customer/page`,
	POST_CUSTOMER_SENDMSG: `${API_PREFIX_CORE}/api/v1/common/customer/sendMsg`,
	GET_CUSTOMER_CONFIG: `${API_PREFIX_CORE}/api/v1/common/config/{key}`,
	
}
/**	
 * 下载
 */

export const getStoreDownload= function(data, config) {
	return http.get(API.GET_STORE_DOWNLOAD, data, config)
}

/**	
 * 流水列表
 */

export const getJyHistory = function(data, config) {
	return http.get(API.GET_JY_HISTORY, data, config ,true)
}

/**	
 * 获取留言列表
 */

export const getCustomerPage = function(data, config) {
	return http.get(API.GET_CUSTOMER_PAGE, data, config)
}

/**	
 * 发送留言消息
 */

export const postCustomerSendmsg = function(data, config) {
	return http.post(API.POST_CUSTOMER_SENDMSG, data, config, true)
}


/**	
 * 根据配置键获取该项配置值
 */

export const getCustomerConfig = function(data, config) {
	return http.get(API.GET_CUSTOMER_CONFIG.replace(/{key}/g, data.key), data, config, true)
}

